<?php
session_start();
define( '_JEXEC', 1 );
define('PATH_BASE', dirname(__FILE__) );
define( 'DS', DIRECTORY_SEPARATOR );
$parts = explode( DS, PATH_BASE );
define( 'PATH_ROOT',			implode( DS, $parts ) );
define( 'PATH_LIBRARIES',	 	PATH_ROOT.DS.'libs' );

// $base_url = "http://localhost/myweb_2";
define( 'BASE_URL'	   ,base_url() );
$tmp = '_';

	require_once ( PATH_LIBRARIES.DS.'db_connect.php' );
	require_once ( PATH_LIBRARIES.DS.'hamhaydung.php' );
	require_once ( PATH_LIBRARIES.DS.'tmp'.DS.'t'.$tmp.'.phtml' );
	require_once ( PATH_LIBRARIES.DS.'component'.$tmp.'.php' );
	require_once ( PATH_LIBRARIES.DS.'execute'.$tmp.'.php' );
	
function base_url(){
    $baseUrl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https://' : 'http://';
    $baseUrl .= isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : getenv('HTTP_HOST');
    return $baseUrl .= isset($_SERVER['SCRIPT_NAME']) ? dirname($_SERVER['SCRIPT_NAME']) : dirname(getenv('SCRIPT_NAME'));
}
?>

